<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网格布局</title>
    <style>
        .container {
            display: grid;
            grid-template-rows: 100px 200px 300px;
            /* 定义两行，高度分别为 100px 和 200px */
            grid-template-columns: 2fr 2fr 2fr;
            /* 定义两列，宽度比例为 1:2 */
            grid-gap: 10px;
            /* 定义网格项之间的间距为 10px */
        }

        .item {
            background-color: #ccc;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="item">网格项1</div>
        <div class="item">网格项2</div>
        <div class="item">网格项3</div>
        <div class="item">网格项4</div>
        <div class="item">网格项11</div>
        <div class="item">网格项12</div>
        <div class="item">网格项13</div>
        <div class="item">网格项14</div>
      </div>
      
</body>

</html>